﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using GalaSoft.MvvmLight;
using ClientSide.Common;

namespace ClientSide.UserControls
{
    public partial class PageItem : Button
    {
        PageItemViewModel pageItemModel;
        public PageItemViewModel PageItemViewModel
        {
            get { return pageItemModel; }
            set { pageItemModel = value; }
        }

        public PageItem()
        {
            InitializeComponent();
            PageItemViewModel = new PageItemViewModel();
            this.DataContext = PageItemViewModel;
            
        }

        public PageItem(IPage Page)
        {
            InitializeComponent();
            PageItemViewModel = new PageItemViewModel();
            this.DataContext = PageItemViewModel;
            PageItemViewModel.Page = Page;
        }
    }

    public class PageItemViewModel : ViewModelBase
    {
        #region Page
        /// <summary>
        /// PropertyDescription
        /// </summary>   
        IPage _Page;
        public IPage Page
        {
            get { return _Page; }
            set
            {
                if (value == _Page) return;
                _Page = value;
                RaisePropertyChanged("Page");
            }
        }
        #endregion Page
    }
}
